import React, { useEffect, useRef, useState } from 'react';
import List from '@component/List';

let timer: NodeJS.Timeout | null = null;
export default function renderList(props: any) {
    const [count, setCount] = useState<number>(0);
    const inputRef = useRef<HTMLInputElement>(null)
    return (
        <div>
            <div>{count}</div>
            <input ref={inputRef} type="text" onChange={(): void => {
                if (timer) {
                    clearTimeout(timer);
                }
                timer = setTimeout(() => {
                    console.log((inputRef.current as HTMLInputElement).value);
                }, 100);
            }} />
        </div>
    );
}
